# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-pytest-forked
pkgver=1.6.0
_commit=ec46db382116f82d36ebc4ceba453b903be7174b
pkgrel=2
pkgdesc='run tests in isolated forked subprocesses'
arch=('any')
license=('MIT')
url='https://github.com/pytest-dev/pytest-forked'
depends=('python-py' 'python-pytest')
makedepends=('git' 'python-setuptools-scm')
source=("git+https://github.com/pytest-dev/pytest-forked.git#commit=$_commit")
sha512sums=('SKIP')

build() {
  cd pytest-forked
  python setup.py build
}

check() {
  # Hack entry points by installing it
  cd pytest-forked
  python setup.py install --root="$PWD/tmp_install" --optimize=1
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  PYTHONPATH="$PWD/tmp_install/$site_packages:$PYTHONPATH" py.test
}

package() {
  cd pytest-forked
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}

# vim:set ts=2 sw=2 et:
